const { spawn } = require('child_process');
const path = require("path");
const fs = require('fs')
const args = process.argv.slice(2);
console.log(args)
console.log(process.cwd())

if (args.length > 0) {
  const cargoNew = spawn('cargo', ['new', ...args], { stdio: 'inherit', cwd: (path.join(process.cwd(), "/src")) });
  cargoNew.on('close', (code) => {
    console.log("创建成功")

  });

}